home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / moni / Scout-src.lha / source / objects / scout_windows.c < prev   
Encoding:
C/C++ Source or Header  |  2002-02-13  |  22.4 KB  |  558 lines

  1. /**
  2.  * Scout - The Amiga System Monitor
  3.  *
  4.  *------------------------------------------------------------------
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program; if not, write to the Free Software
  18.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  *
  20.  * You must not use this source code to gain profit of any kind!
  21.  *
  22.  *------------------------------------------------------------------
  23.  *
  24.  * @author Andreas Gelhausen
  25.  * @author Richard Körber <rkoerber@gmx.de>
  26.  */
  27.  
  28.  
  29.  
  30. #include "system_headers.h"
  31.  
  32. APTR BT_WinUpdate,BT_WinPrint,BT_WinClose,BT_WinToFront,BT_WinMore,BT_WinExit;
  33. APTR wintext,winlist;
  34. APTR winmoretext0,winmoretext1,winmoretext2,winmoretext3,winmoretext4;
  35. APTR winmoretext5,winmoretext6a,winmoretext6b,winmoretext7a,winmoretext7b,winmoretext8,winmoretext9;
  36. APTR winmoretext10,winmoretext11,winmoretext12,winmoretext13,winmoretext14;
  37. APTR screenmoretext0,screenmoretext1,screenmoretext2,screenmoretext3;
  38. APTR screenmoretext4,screenmoretext5a,screenmoretext5b,screenmoretext6,screenmoretext7;
  39. APTR screenmoretext8,screenmoretext9,screenmoretext10;
  40.  
  41. static APTR WinPool = NULL;
  42.  
  43.  
  44. void CloseScreenAll (struct Screen *screen) {
  45.    struct Window *win,*nextwin;
  46.  
  47.    win = screen->FirstWindow;
  48.    while (win) {
  49.      nextwin = win->NextWindow;
  50.      CloseWindow (win);
  51.      win = nextwin;
  52.    }
  53.    CloseScreen (screen);
  54. }
  55.  
  56. __asm __saveds LONG winlist_dspfunc(register __a2 char **array, register __a1 struct WinEntry *winentry, register __a0 struct Hook *hook)
  57. {
  58.    if (winentry) {
  59.       *array++ = winentry->wn_address;
  60.       *array++ = winentry->wn_position;
  61.       *array++ = winentry->wn_size;
  62.       *array++ = winentry->wn_flags;
  63.       *array++ = winentry->wn_idcmp;
  64.       *array++ = winentry->wn_title;
  65.       *array   = NULL;
  66.    } else {
  67.       *array++ = ESC "bAddress";
  68.       *array++ = ESC "bPos(x,y)";
  69.       *array++ = ESC "bSize(x,y)";
  70.       *array++ = ESC "bFlags";
  71.       *array++ = ESC "bIDCMP";
  72.       *array++ = ESC "bTitle";
  73.       *array   = NULL;
  74.    }
  75.    return(0);
  76. }
  77.  
  78. struct Hook winlist_dsphook = {
  79.  {NULL, NULL},
  80.  (ULONG (* )())winlist_dspfunc,
  81.  NULL, NULL
  82. };
  83.  
  84. void FreeWindows (void)
  85. {
  86.     MyFreePoolStructs(&WinPool, wintext, NULL, winlist);
  87. }
  88.  
  89. int GetWindows (struct WinEntry **first) {
  90.    struct   WinEntry    *winentry,*previous = NULL;
  91.    struct   Screen      *screen;
  92.    struct   Window      *window;
  93.  
  94.    int wincnt = 0;
  95.    *first = 0;
  96.  
  97.    if (!WinPool) WinPool = tbCreatePool(MEMF_CLEAR, 4096, 4096);
  98.  
  99.    if (clientstate) {
  100.       if (SendDaemon ("GetWinList")) {
  101.          while ((winentry = tbAllocPooled(WinPool, sizeof(struct WinEntry))) \
  102.            && (ReceiveDecodedEntry ((UBYTE *) winentry, sizeof (struct WinEntry)))) {
  103.             if (! IsHex (winentry->wn_address, (long *) &winentry->wn_adr))
  104.                IsHex (winentry->wn_address + 2, (long *) &winentry->wn_adr);
  105.  
  106.             if (! *first)
  107.                *first = winentry;
  108.             if (previous)
  109.                previous->wn_next = winentry;
  110.  
  111.             wincnt++;
  112.             previous = winentry;
  113.          }
  114.       }
  115.    } else {
  116.       screen = FIRSTSCREEN;
  117.    
  118.       while ((screen) && (winentry = tbAllocPooled(WinPool, sizeof(struct WinEntry)))) {
  119.          if (! *first)
  120.             *first = winentry;
  121.          if (previous)
  122.             previous->wn_next = winentry;
  123.    
  124.          winentry->wn_adr = (char *) screen;
  125.    
  126.          _sprintf (winentry->wn_address, HELL "$%08lx", screen);
  127.          _sprintf (winentry->wn_position, HELL "%4ld,%-4ld", screen->LeftEdge, screen->TopEdge);
  128.          _sprintf (winentry->wn_size, HELL "%4ld,%-4ld", screen->Width, screen->Height);
  129.          _sprintf (winentry->wn_flags, HELL "$%04lx",screen->Flags);
  130.          strcpy (winentry->wn_idcmp, HELL "---------");
  131.          _sprintf (winentry->wn_title, HELL "%-."TEXTLENGTHCHAR"s", nonetest (screen->Title));
  132.          winentry->wn_type = 'S';
  133.    
  134.          wincnt++;
  135.          previous = winentry;
  136.          window = screen->FirstWindow;
  137.    
  138.          while ((window) && (winentry = tbAllocPooled(WinPool, sizeof(struct WinEntry)))) {
  139.             if (! *first)
  140.                *first = winentry;
  141.             if (previous)
  142.                previous->wn_next = winentry;
  143.    
  144.             winentry->wn_adr = (char *) window;    
  145.             _sprintf (winentry->wn_address, "$%08lx", window);
  146.             _sprintf (winentry->wn_position, "%4ld,%-4ld", window->LeftEdge, window->TopEdge);
  147.             _sprintf (winentry->wn_size, "%4ld,%-4ld", window->Width, window->Height);
  148.             _sprintf (winentry->wn_flags, "$%08lx", window->Flags);
  149.             _sprintf (winentry->wn_idcmp, "$%08lx", window->IDCMPFlags);
  150.             _sprintf (winentry->wn_title, "%-."TEXTLENGTHCHAR"s", nonetest (window->Title));
  151.             winentry->wn_type = 'W';
  152.    
  153.             wincnt++;
  154.             previous = winentry;
  155.             window = window->NextWindow;
  156.          }
  157.          screen = screen->NextScreen;
  158.       }
  159.    }
  160.    return (wincnt);
  161. }
  162.  
  163. void PrintWindows (char *filename) {
  164.    int   i=1;
  165.    BPTR  handle;
  166.    struct WinEntry *entryp = NULL;
  167.  
  168.    handle = HandlePrintStart (filename);
  169.    if ((handle) && (PrintOneLine (handle, "\n  Address  Pos(x,y)  Size(x,y) Flags     IDCMP     Title\n\n"))) {
  170.       if (! WI_Windows) {
  171.          i = GetWindows (&entryp);
  172.       }
  173.       if (i) {
  174.          for (i=0;;i++) {
  175.             if (WI_Windows)
  176.                DoMethod (winlist,MUIM_List_GetEntry,i,&entryp);
  177.             if (!entryp) break;
  178.  
  179.             if (entryp->wn_type == 'S') {
  180.                _sprintf (tmpstr2, " $%08lx %s %s %-9.9s %s %-26.26s\n", entryp->wn_adr, entryp->wn_position+2, entryp->wn_size+2, entryp->wn_flags+2, entryp->wn_idcmp+2, entryp->wn_title+2);
  181.             } else {
  182.                _sprintf (tmpstr2, " $%08lx %s %s %-9.9s %s %-26.26s\n", entryp->wn_adr, entryp->wn_position, entryp->wn_size, entryp->wn_flags, entryp->wn_idcmp, entryp->wn_title);
  183.             }
  184.  
  185.             if (! (PrintOneLine (handle, tmpstr2)))
  186.                break;
  187.  
  188.             if (! WI_Windows)
  189.                entryp = entryp->wn_next;
  190.          }
  191.       }
  192.    }
  193.    HandlePrintStop();
  194. }
  195.  
  196. void ShowWindows (void) {
  197.    struct   WinEntry    *win;
  198.  
  199.    ApplicationSleep();
  200.    set(winlist,MUIA_List_Quiet,TRUE);
  201.    set(BT_WinClose, MUIA_Disabled, TRUE);
  202.    set(BT_WinToFront, MUIA_Disabled, TRUE);
  203.    set(BT_WinMore, MUIA_Disabled, TRUE);
  204.  
  205.    FreeWindows();
  206.  
  207.    GetWindows (&win);
  208.  
  209.    while (win) {
  210.       InsertBottomEntry (winlist, (APTR *) &win);
  211.       win = win->wn_next;
  212.    }
  213.  
  214.    AwakeApplication();
  215.    set(winlist,MUIA_List_Quiet,FALSE);
  216. }
  217.  
  218. void SendWinList (void) {
  219.    struct   WinEntry    *win;
  220.  
  221.    FreeWindows();
  222.    GetWindows (&win);
  223.  
  224.    while (win) {
  225.       SendEncodedEntry ((UBYTE *) win, sizeof (struct WinEntry));
  226.       win = win->wn_next;
  227.    }
  228.    FreeWindows();
  229. }
  230.  
  231. void GetWindowMore (struct Window *win) {
  232.    unsigned char     *title = "WINDOW: ";
  233.    struct TextFont   *font;
  234.    struct   WinFree  *ptr;
  235.  
  236.    if (ptr = AllocWinFree()) {
  237.       ptr->wf_Window = (APTR) WindowObject,
  238.  
  239. //      MUIA_Window_SizeGadget, FALSE,
  240.       MUIA_HelpNode, WindowsText,
  241.       MUIA_Window_ID, MakeDetailID('.','W','I','N'),
  242.       WindowContents, HGroup,
  243.          Child, VGroup, MUIA_Group_SameWidth, TRUE,
  244. //#ifndef WINDOW_PROBLEMS
  245.             Child, MyLabel2 ("Title:"),
  246. //#endif
  247.             Child, MyLabel2 ("ScreenTitle:"),
  248.             Child, MyLabel2 ("LeftEdge:\nTopEdge:\nMinWidth:\nMinHeight:\nBorderRight:\nBorderBottom:"),
  249.             Child, MyLabel2 ("NextWindow:\nFirstRequest:\nRPort:\nParent:\nExtData:"),
  250.             Child, MyLabel2 ("IDCMPFlags:"),
  251.             Child, MyLabel2 ("ReqCount:"),
  252.             Child, MyLabel2 ("UserPort:"),
  253.             Child, MyLabel2 ("WindowPort:"),
  254.          End,
  255.          Child, VGroup, MUIA_Group_SameWidth, TRUE,
  256. //#ifndef WINDOW_PROBLEMS
  257.             Child, winmoretext0 = MyTextObject(),
  258. //#endif
  259.             Child, winmoretext1 = MyTextObject(),
  260.             Child, HGroup,
  261.                Child, winmoretext2 = MyTextObject2(),
  262.                Child, MyLabel ("Width:\nHeight:\nMaxWidth:\nMaxHeight:\nPtrHeight:\nPtrWidth:"),
  263.                Child, winmoretext3 = MyTextObject2(),
  264.                Child, MyLabel ("MouseY:\nMouseX:\nBorderLeft:\nBorderTop:\nXOffset:\nYOffset:"),
  265.                Child, winmoretext4 = MyTextObject2(),
  266.                Child, MyLabel ("DetailPen:\nBlockPen:\nGZZMouseX:\nGZZMouseY:\nGZZWidth:\nGZZHeight:"),
  267.                Child, winmoretext5 = MyTextObject2(),
  268.             End,
  269.             Child, HGroup,
  270.                Child, VGroup, MUIA_Group_SameWidth, TRUE, MUIA_Weight, 0,
  271.                   Child, winmoretext6a = MyTextObject(),
  272.                   Child, winmoretext6b = KeyButtonF ('l', win->IDCMPFlags),
  273.                   Child, winmoretext9 = MyTextObject(),
  274.                   Child, winmoretext10 = MyTextObject(),
  275.                   Child, winmoretext11 = MyTextObject(),
  276.                End,
  277.                Child, VGroup, MUIA_Group_SameWidth, TRUE, MUIA_Weight, 60,
  278.                   Child, MyLabel ("Flags:"),
  279.                   Child, MyLabel ("DMRequest:\nBorderRPort:\nDescendant:\nMessageKey:\nUserData:"),
  280.                   Child, MyLabel ("IFont:"),
  281.                   Child, MyLabel ("-> SigTask:"),
  282.                   Child, MyLabel ("-> SigTask:"),
  283.                End,
  284.                Child, VGroup,
  285.                   Child, HGroup, 
  286.                      Child, VGroup, MUIA_Group_SameWidth, TRUE, MUIA_Weight, 0,
  287.                         Child, winmoretext7a = KeyButtonF ('l', win->Flags),
  288.                         Child, winmoretext7b = MyTextObject(),
  289.                      End,
  290.                      Child, HGroup, MUIA_Weight, 60,
  291.                         Child, MyLabel ("MenuStrip:\nWScreen:\nFirstGadget:\nPointer:\nCheckMark:\nWLayer:"),
  292.                      End,
  293.                      Child, winmoretext8 = MyTextObject2(),
  294.                   End,
  295.                   Child, winmoretext12 = MyTextObject(),
  296.                   Child, winmoretext13 = MyTextObject(),
  297.                   Child, winmoretext14 = MyTextObject(),
  298.                End,
  299.             End,
  300.          End,
  301.       End, End;
  302.  
  303.       if (ptr->wf_Window) {
  304.          MySetContents (winmoretext2, ESC "r%ld\n%ld\n%ld\n%ld\n%ld\n%ld", win->LeftEdge, win->TopEdge, win->MinWidth, win->MinHeight, win->BorderRight, win->BorderBottom);
  305.          MySetContents (winmoretext3, ESC "r%ld\n%ld\n%ld\n%ld\n%ld\n%ld", win->Width, win->Height, win->MaxWidth, win->MaxHeight, win->PtrHeight, win->PtrWidth);
  306.          MySetContents (winmoretext4, ESC "r%ld\n%ld\n%ld\n%ld\n%ld\n%ld", win->MouseY, win->MouseX, win->BorderLeft, win->BorderTop, win->XOffset, win->YOffset);
  307.          MySetContents (winmoretext5, ESC "r%ld\n%ld\n%ld\n%ld\n%ld\n%ld", win->DetailPen, win->BlockPen, win->GZZMouseX, win->GZZMouseY, win->GZZWidth, win->GZZHeight);
  308.          MySetContents (winmoretext6a, ESC "r$%08lx\n$%08lx\n$%08lx\n$%08lx\n$%08lx", win->NextWindow, win->FirstRequest, win->RPort, win->Parent, win->ExtData);
  309.          MySetContents (winmoretext7b, ESC "r$%08lx\n$%08lx\n$%08lx\n$%08lx\n$%08lx", win->DMRequest, win->BorderRPort, win->Descendant, win->MessageKey, win->UserData);
  310.          MySetContents (winmoretext8, ESC "r$%08lx\n$%08lx\n$%08lx\n$%08lx\n$%08lx\n$%08lx", win->MenuStrip, win->WScreen, win->FirstGadget, win->Pointer, win->CheckMark, win->WLayer);
  311.          MySetContents (winmoretext9, ESC "r%ld", win->ReqCount);
  312.          MySetContents (winmoretext10, ESC "r$%08lx", win->UserPort);
  313.          MySetContents (winmoretext11, ESC "r$%08lx", win->WindowPort);
  314.  
  315.          HandleFlagsButtonPressed (winmoretext6b, ptr, "(WINDOW)", "IDCMPFlags", win->IDCMPFlags, (struct LongFlag *) &idcmp_flags, NULL, 'l');
  316.          HandleFlagsButtonPressed (winmoretext7a, ptr, "(WINDOW)", "Flags", win->Flags, (struct LongFlag *) &wflg_flags, (struct MaskedLongFlag *) &wflg_flags2, 'l');
  317.          HandleWindowOpen (ptr, title, nonetest (win->Title));
  318.  
  319. //#ifndef WINDOW_PROBLEMS
  320.          MySetContents (winmoretext0, nonetest (win->Title));
  321. //#endif
  322.          MySetContents (winmoretext1, nonetest (win->ScreenTitle));
  323.  
  324.          font = win->IFont;
  325.          MySetContents (winmoretext12, "%s/%ld", font->tf_Message.mn_Node.ln_Name, font->tf_YSize);
  326.  
  327.                         if (win->UserPort) {
  328.             MySetContentsHealed (winmoretext13, nonetest (GetTaskName (win->UserPort->mp_SigTask)));
  329.                         }
  330.                         
  331.                         if (win->WindowPort) {
  332.             MySetContentsHealed (winmoretext14, nonetest (GetTaskName (win->WindowPort->mp_SigTask)));
  333.                         }
  334.  
  335.          HandleWindowClose (ptr);
  336.       }
  337.    }
  338. }
  339.  
  340. void GetScreenMore (struct Screen *screen) {
  341.    unsigned char        *title = "SCREEN: ";
  342.    struct   TextAttr    *font;
  343.    struct   WinFree     *ptr;
  344.    char     buf[sizeof(struct NameInfo)];
  345.    APTR     handle;
  346.    ULONG    ID;
  347.  
  348.    struct   List           *publist;
  349.    struct   PubScreenNode  *pubscreen;
  350.    struct   MonitorSpec    *mspc;
  351.  
  352.    if (ptr = AllocWinFree()) {
  353.       APTR  AddGroup1, AddGroup2, AddGroup3;
  354.  
  355.       ptr->wf_Window = (APTR) WindowObject,
  356.  
  357. //      MUIA_Window_SizeGadget, FALSE,
  358.       MUIA_HelpNode, WindowsText,
  359.       MUIA_Window_ID, MakeDetailID('.','W','I','N'),
  360.       WindowContents, HGroup,
  361.          Child, AddGroup1 = VGroup,
  362. //#ifndef WINDOW_PROBLEMS
  363.             Child, MyLabel2 ("Title:"),
  364. //#endif
  365.             Child, MyLabel2 ("DefaultTitle:"),
  366.             Child, MyVSpace(0),
  367.             Child, MyLabel2 ("LeftEdge:\nTopEdge:\nWidth:\nHeight:\nDetailPen:"),
  368.             Child, MyVSpace(0),
  369.             Child, MyLabel2 ("ScreenMode:"),
  370.             Child, MyLabel2 ("NextScreen:\nFirstWindow:"),
  371.          End,
  372.          Child, AddGroup2 = VGroup, MUIA_Group_SameWidth, TRUE,
  373. //#ifndef WINDOW_PROBLEMS
  374.             Child, screenmoretext0 = MyTextObject(),
  375. //#endif
  376.             Child, screenmoretext1 = MyTextObject(),
  377.  
  378.             Child, HGroup,
  379.                Child, screenmoretext2 = MyTextObject2(),
  380.                Child, MyLabel ("BarVBorder:\nBarHBorder:\nMenuVBorder:\nMenuHBorder:\nBlockPen:"),
  381.                Child, screenmoretext3 = MyTextObject2(),
  382.                Child, MyLabel ("WBorTop:\nWBorLeft:\nWBorRight:\nWBorBottom:\nDepth:"),
  383.                Child, screenmoretext4 = MyTextObject2(),
  384.                Child, VGroup,
  385.                   Child, MyLabel ("MouseY:\nMouseX:\nBarHeight:\nSaveColor0:"),
  386.                   Child, MyLabel ("Flags:"),
  387.                End,
  388.                Child, VGroup, MUIA_Group_SameWidth, TRUE, MUIA_Weight, 0,
  389.                   Child, screenmoretext5a = MyTextObject(),
  390.                   Child, screenmoretext5b = KeyButtonF ('w', screen->Flags),
  391.                End,
  392.             End,
  393.  
  394.             Child, HGroup, MUIA_Group_SameWidth, TRUE,
  395.                Child, screenmoretext10 = MyTextObject(),
  396.                Child, HGroup,
  397.                   Child, MyLabel2 ("Font:"),
  398.                   Child, screenmoretext9 = MyTextObject(),
  399.                End,
  400.             End,
  401.  
  402.             Child, HGroup,
  403.                Child, screenmoretext6 = MyTextObject2(),
  404.                Child, MyLabel ("FirstGadget:\nBarLayer:"),
  405.                Child, screenmoretext7 = MyTextObject2(),
  406.                Child, MyLabel ("ExtData:\nUserData:"),
  407.                Child, screenmoretext8 = MyTextObject2(),
  408.             End,
  409.          End,
  410.       End, End;
  411.  
  412.       if (ptr->wf_Window) {
  413.          MySetContents (screenmoretext2, ESC "r%ld\n%ld\n%3ld\n%ld\n%ld", screen->LeftEdge, screen->TopEdge, screen->Width, screen->Height, screen->DetailPen);
  414.          MySetContents (screenmoretext3, ESC "r%ld\n%ld\n%3ld\n%ld\n%ld", screen->BarVBorder, screen->BarHBorder, screen->MenuVBorder, screen->MenuHBorder, screen->BlockPen);
  415.          MySetContents (screenmoretext4, ESC "r%ld\n%ld\n%3ld\n%ld\n%ld", screen->WBorTop, screen->WBorLeft, screen->WBorRight, screen->WBorBottom, GetBitMapAttr(screen->RastPort.BitMap, BMA_DEPTH));
  416.          MySetContents (screenmoretext5a, ESC "r%ld\n%ld\n%ld\n%ld", screen->MouseY, screen->MouseX, screen->BarHeight, screen->SaveColor0);
  417.  
  418.          MySetContents (screenmoretext6, ESC "r$%08lx\n$%08lx", screen->NextScreen, screen->FirstWindow);
  419.          MySetContents (screenmoretext7, ESC "r$%08lx\n$%08lx", screen->FirstGadget, screen->BarLayer);
  420.          MySetContents (screenmoretext8, ESC "r$%08lx\n$%08lx", screen->ExtData, screen->UserData);
  421.  
  422.          font = screen->Font;
  423.          MySetContents (screenmoretext9, "%s/%ld", font->ta_Name, font->ta_YSize);
  424.  
  425.          if (publist = LockPubScreenList()) {
  426.             pubscreen = (struct PubScreenNode *) publist->lh_Head;
  427.  
  428.             while (pubscreen->psn_Node.ln_Succ != 0) {
  429.                if (pubscreen->psn_Screen == screen) {
  430.                                 DoMethod (AddGroup1,OM_ADDMEMBER,MyLabel2 ("PublicName:"));
  431.                                 DoMethod (AddGroup1,OM_ADDMEMBER,MyLabel2 ("SigTask:"));
  432.  
  433.                   Child, AddGroup3 = HGroup,
  434.                      Child, VGroup,
  435.                         Child, HGroup,
  436.                            Child, screenmoretext2 = MyTextObject(),
  437.                            Child, HGroup, MUIA_Weight, 0,
  438.                                                 Child, MyLabel ("Flags:"),
  439.                               Child, screenmoretext3 = KeyButtonF ('w', pubscreen->psn_Flags),
  440.                            End,
  441.                         End,
  442.                         Child, screenmoretext6 = MyTextObject(),
  443.                      End,
  444.                      Child, VGroup,
  445.                         Child, MyLabel2 ("Visitors:"),
  446.                         Child, MyLabel2 ("SigBit:"),
  447.                      End,
  448.                      Child, VGroup, MUIA_Group_SameWidth, TRUE,
  449.                         Child, screenmoretext4 = MyTextObject(),
  450.                         Child, screenmoretext5a = MyTextObject2(),
  451.                      End,
  452.                   End;
  453.                   MySetContents (screenmoretext2, pubscreen->psn_Node.ln_Name);
  454.                   HandleFlagsButtonPressed (screenmoretext3, ptr, "(SCREEN)", "psn_Flags", pubscreen->psn_Flags, (struct LongFlag *) &psn_flags, NULL, 'w');
  455.                   MySetContents (screenmoretext4, ESC "r%ld", pubscreen->psn_VisitorCount);
  456.                   if (pubscreen->psn_SigBit != 255)
  457.                      MySetContents (screenmoretext5a, ESC "r%3ld", pubscreen->psn_SigBit);
  458.                   else
  459.                      MySetContents (screenmoretext5a, ESC "r---");
  460.                   MySetContents (screenmoretext6, nonetest (GetTaskName (pubscreen->psn_SigTask)));
  461.                                    DoMethod (AddGroup2,OM_ADDMEMBER,AddGroup3);
  462.                }
  463.                pubscreen = (struct PubScreenNode *) pubscreen->psn_Node.ln_Succ;
  464.             }
  465.             
  466.             UnlockPubScreenList();
  467.          }
  468.  
  469.          HandleFlagsButtonPressed (screenmoretext5b, ptr, "(SCREEN)", "Flags", screen->Flags, (struct LongFlag *) &scr_flags, (struct MaskedLongFlag *) &scr_flags2, 'w');
  470.          HandleWindowOpen (ptr, title, nonetest (screen->Title));
  471. //#ifndef WINDOW_PROBLEMS
  472.          MySetContents (screenmoretext0, nonetest (screen->Title));
  473. //#endif
  474.          MySetContents (screenmoretext1, screen->DefaultTitle);
  475.          HandleWindowClose (ptr);
  476.  
  477.          if (ID = GetVPModeID (&screen->ViewPort)) {
  478.             if (handle = FindDisplayInfo (ID)) {
  479.                if (GetDisplayInfoData(handle, (UBYTE *) &buf, sizeof (struct NameInfo), DTAG_NAME, 0)) {
  480.                   _sprintf (tmpstr, "%s  ($%08lx)", ((struct NameInfo *) &buf)->Name, ID);
  481.                                 MySetContents (screenmoretext10, tmpstr);
  482.                } else {
  483.                if (mspc = OpenMonitor (NULL, ID)) {
  484.                   int   i = 0;
  485.                   struct DimensionInfo diminfo;
  486.  
  487.                   strcpy (tmpstr, ((struct Node *) mspc)->ln_Name);
  488.                   while (tmpstr[i] = toupper(tmpstr[i])) {
  489.                      if (tmpstr[i] == '.') {
  490.                         strcpy (&tmpstr[i++], ":");;
  491.                         break;
  492.                      }
  493.                      i++;
  494.                   }
  495.                   GetDisplayInfoData (handle, (UBYTE *) &diminfo, sizeof (struct DimensionInfo), DTAG_DIMS, 0);
  496. //aprintf ("MONITOR: %ls %ld x %ld\n", tmpstr, diminfo.Nominal.MaxX - diminfo.Nominal.MinX, diminfo.Nominal.MaxY - diminfo.Nominal.MinY);
  497. _sprintf (&tmpstr[i], "%ld x %ld  ($%08lx)", diminfo.Nominal.MaxX - diminfo.Nominal.MinX + 1, diminfo.Nominal.MaxY - diminfo.Nominal.MinY + 1, ID);
  498.                                 MySetContents (screenmoretext10, tmpstr);
  499.                   CloseMonitor (mspc);
  500.                }
  501.                }
  502.             }
  503.          }
  504.       }
  505.    }
  506. }
  507.  
  508.  
  509. char windows_title[WINDOWTITLELEN];
  510.  
  511. void WindowsWindow (BOOL state) {
  512.    if (state) {
  513.       if (WI_Windows) {
  514.          ShowWindows();
  515.       } else {
  516.          WI_Windows = WindowObject,
  517.          MUIA_Window_Title, MyGetWindowTitle (windows_title, "WINDOWS & SCREENS"),
  518.          MUIA_HelpNode, WindowsText,
  519.          MUIA_Window_ID, MakeListID('W','I','N','D'),
  520.          WindowContents, VGroup,
  521.             Child, winlist = MyListviewObject ("COL=0 DELTA=8,COL=1 DELTA=8 P=\33c,COL=2 DELTA=8 P=\33c,COL=3 DELTA=8,COL=4 DELTA=8,COL=5",&winlist_dsphook),
  522.             Child, wintext = MyTextObject(),
  523.             Child, MyVSpace(2),
  524.             Child, HGroup, MUIA_Group_SameSize, TRUE,
  525.                Child, BT_WinUpdate  = KeyButtonA (UpdateText,ID_WINUPDATE),
  526.                Child, BT_WinPrint   = KeyButtonA (PrintText ,ID_WINPRINT),
  527.                Child, BT_WinClose   = KeyButtonA (CloseText ,ID_WINCLOSE),
  528.                Child, BT_WinToFront = KeyButtonA (ToFrontText ,ID_WINTOFRONT),
  529.                Child, BT_WinMore    = KeyButtonA (MoreText  ,ID_WINMORE),
  530.                Child, BT_WinExit    = KeyButtonA (ExitText  ,ID_WINEXIT),
  531.             End,
  532.          End, End;
  533.  
  534.          DoMethod (AP_Scout,OM_ADDMEMBER,WI_Windows);
  535.          DoMethod (WI_Windows,MUIM_Window_SetCycleChain,winlist,BT_WinUpdate,BT_WinPrint,BT_WinClose,BT_WinToFront,BT_WinMore,BT_WinExit,NULL);
  536.  
  537.          SetCloseRequest (WI_Windows,ID_WINEXIT);
  538.          SetListActive (winlist,ID_WINLV_ACTIVE);
  539.          SetListviewDoubleClick (winlist,ID_WINMORE);
  540.  
  541.          SetWindowOpen (WI_Windows,winlist,ID_WINEXIT);
  542.  
  543.          ShowWindows();
  544.       }
  545.    } else if ((! state) && (WI_Windows)) {
  546.       SetWindowClose (WI_Windows,TRUE);
  547.  
  548.       FreeWindows();
  549.  
  550.       DoMethod (AP_Scout,OM_REMMEMBER,WI_Windows);
  551.       MUI_DisposeObject (WI_Windows);
  552.       WI_Windows = NULL;
  553.       winlist = NULL;
  554.    }
  555. }
  556.  
  557.  
  558.